/*
 * Copyright (c) 2017. 杭州端点网络科技有限公司.  All rights reserved.
 */

package com.jiantong.user.enums;


/**
 * Author: songrenfei
 * Date: 2017-02-28
 */
public enum ContactStatus {


    VALID(1, "有效的"),
    INVALID(-1, "无效的");

    private final int value;

    private final String description;

    private ContactStatus(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static ContactStatus from(int value) {
        for (ContactStatus ta : ContactStatus.values()) {
            if (ta.value == value) {
                return ta;
            }
        }
        return null;
    }

    public int value() {
        return this.value;
    }


    @Override
    public String toString() {
        return description;
    }
}
